import React from 'react';
import {formatMessage, FormattedMessage} from '@/utils/locale';
import {Button} from 'antd';
import Result from '@/components/Result';
import styles from './RegisterResult.less';
import {Link} from "react-router-dom";

const actions = (
  <div className={styles.actions}>
    <Link to="/user/login/">
      <Button size="large">
        前往登录
      </Button>
    </Link>
  </div>
);

const RegisterResult = ({location}) => {
  return (
    <Result
      className={styles.registerResult}
      type="success"
      title={
        <div className={styles.title}>
          <FormattedMessage
            id="app.register-result.msg"
            values={{email: location.state ? location.state.mobile : ''}}
          />
        </div>
      }
      description={formatMessage({id: 'app.register-result.forward'})}
      actions={actions}
      style={{marginTop: 56}}
    />
  );
};

export default RegisterResult;
